CREATE TABLE [dbo].[C_MATCHES]
(
[cup] [numeric] (4, 0) NOT NULL,
[matchId] [numeric] (2, 0) NOT NULL,
[matchDate] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[stadium] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[C_MATCHES] ADD CONSTRAINT [ch_C_Matches_match] CHECK (([matchId]>(0)))
GO
ALTER TABLE [dbo].[C_MATCHES] ADD CONSTRAINT [pk_C_Matches] PRIMARY KEY CLUSTERED  ([cup], [matchId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[C_MATCHES] ADD CONSTRAINT [fk_C_Matches_date] FOREIGN KEY ([cup], [matchDate]) REFERENCES [dbo].[C_MATCHSTAGES] ([cup], [matchDate])
GO
ALTER TABLE [dbo].[C_MATCHES] ADD CONSTRAINT [fk_C_Matches_stadium] FOREIGN KEY ([stadium]) REFERENCES [dbo].[C_STADIUMS] ([stadium])
GO
